!{include file='common/iheader.htm'}
<style>
.option_div{position:absolute;width:98%;bottom:0;left:0;}
.cate_list_options{display:none;position:absolute;border:1px solid #AED0EA;background:white;}
.cate_list_options li{padding:3px 10px;cursor:pointer;}
.cate_list_options li:hover{background:#EBF4FA;}
#cate_list{display:none;}
.tab_content{height:284px;overflow:auto;}
.widget_template_ul{float:none;}
</style>
<div id="i_nav">
	<h3 class="page_title">!{$cate}</h3>
	<a class="button" href="admin.php?app=widget&act=edit">添加组件</a> 
</div>
<div class="tabs">
	<ul>
	!{foreach from=$widgets item=widget key=widget_name}
		<li><a href="#!{$widget_name}">!{$widget.name}</a>
	!{/foreach}
	</ul>
	!{foreach from=$widgets item=widget key=widget_name}
		<div id="!{$widget_name}" class="tab_content">
			<div class="form_item form_btn_item">
				<a class="button" href="/admin.php?app=widget&act=edit&id=!{$widget_name}">修改</a>
			</div>
			<ul class="image_list widget_template_ul">
				!{foreach from=$widget.templates item=template key=template_name}
				<li>
					<img src="!{res file=$template.template_thumb thumb=80x80}" class="auto_img" title="!{$template.template_name}" alt="!{$template.template_name}">
				</li>
				!{/foreach}
			</ul>
		</div>
	!{/foreach}
</div>
<script>
	function del(id){
		if(confirm('删除将可能造成引用它的地方失败，是否继续？')){
			$.get('/manager.php?app=file&act=del&id=' + id,function(data){
				var json = eval('('+data+')');
				alert(json.info);
				if(json.result){
					window.location.reload();
				}
			});
		}
	}
	
	$(function(){
		$('.tabs').tabs();
		$('.button').button();
	});
</script>
!{include file='common/ifooter.htm'}